Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.naming
Class Identifier<V>

    java.lang.Object
      rdlc.naming.Identifier<V>

Direct Known Subclasses:
  Instance.Identifier, Namespace.Identifier

    public class Identifier<V>

extends java.lang.Object

This class abstracts an identifier within a naming hierarchy constructed from `HierarchicalCatalog`s. The difference between this and a `Binding` is that an identifier is aware of the hierarchy, whereas a `Binding` is only aware of the level at which it exists.

Version:
  $Revision: 1.8 $
Author:
  Greg Gibeling

Field Summary
`protected Accessor<V>` | `accessor` The accessor which this identifier should use to traverse the hierarchy.
`protected V` | `cachedValue` The cached value this identifier names.
`protected java.lang.Object` | `catalog` The catalog in which this identifier names it's value.
`protected java.lang.String` | `name` The name of this identifier's value in it's catalog.

Constructor Summary
`protected` | `Identifier(Identifier<V> _identifier)` Copy constructor.
`protected` | `Identifier(java.lang.Object _catalog, Accessor<V> _accessor, java.lang.String _name, V _cachedValue)` Base constructs, simply stores all the relevant fields into this identifier.

Method Summary
`V` | `get()` Simple accessor.
`HierarchicalCatalog<V>` | `getCatalog()` Get the catalog in which this identifier is finally bound to an object rather than another catalog.
`java.util.List<java.lang.String>` | `getComplete()` Get the path and name for this identifier combined in a list.
`java.lang.String` | `getComplete(java.lang.String separator, boolean rootSeparator)` Get the path and name for this identifier combined.
`java.lang.String` | `getName()` Get the name for this identifier.
`java.lang.String` | `getPath(java.lang.String separator, boolean rootSeparator)` Get the path for this identifier.
`QualifiedIdentifier<V>` | `getRelative(java.lang.Object _catalog)` Return a `QualifiedIdentifier` which names the same object as this identifier, but relative to the given catalog.
`int` | `hashCode()` Simple accessor.
`boolean` | `isLambda()` Check if this identifier doesn't actually have a real name to go with it.
`V` | `put(V _value)` Bind the name specified by this identifier to the given value and return the old value to which this identifier was bound.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### catalog

    protected java.lang.Object catalog

  The catalog in which this identifier names it's value. `catalog` and `name` together form a `Binding`.

  See Also:
    `name`

### accessor

    protected Accessor<V> accessor

  The accessor which this identifier should use to traverse the hierarchy.

### name

    protected java.lang.String name

  The name of this identifier's value in it's catalog. `catalog` and `name` together form a `Binding`.

### cachedValue

    protected V cachedValue

  The cached value this identifier names. This is used to accelerate calls to `get()`, and for creating identifiers for values not actually bound in any catalog (lambdas or unnameds).

  See Also:
    `get()`

Constructor Detail

### Identifier

    protected Identifier(java.lang.Object _catalog,
                         Accessor<V> _accessor,
                         java.lang.String _name,
                         V _cachedValue)

  Base constructs, simply stores all the relevant fields into this identifier.

  Parameters:
    `_catalog` - The catalog in which this identifier names a value.
    `_accessor` - The `Accessor` to use to traverse the catalog hierarchy.
    `_name` - The name of the value, might be `null` for unnamed values.
    `_cachedValue` - The value which this identifier names, must not be `null` for unnamed values, otherwise can be `null`.

### Identifier

    protected Identifier(Identifier<V> _identifier)

  Copy constructor.

  Parameters:
    `_identifier` - The identifier to copy.

Method Detail

### hashCode

    public int hashCode()

  Simple accessor.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    Simple hash function of the name and location of this identifier.

### getName

    public java.lang.String getName()

  Get the name for this identifier. This will be the final component of the identifier's path, that which names a single binding in the last catalog searched along the path.

  Returns:
    The string name of the object this identifier names.
  See Also:
    `getPath(String, boolean)`, `getComplete(String, boolean)`, `getComplete()`

### getPath

    public java.lang.String getPath(java.lang.String separator,
                                    boolean rootSeparator)

  Get the path for this identifier. This should include all components of the fully qualified path not returned by `getName()`. These components should identify the parent catalog, starting from the root, wherein the object named by this identifier is finally bound.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
    `rootSeparator` - `true` indicates the root is denoted with a leading separator.
  Returns:
    All but the last component of a fully qualified path.
  See Also:
    `getName()`, `getComplete(String, boolean)`, `getComplete()`

### getComplete

    public java.lang.String getComplete(java.lang.String separator,
                                        boolean rootSeparator)

  Get the path and name for this identifier combined. This will include the values returned by `getPath()` and `getName()` in that order.

  Parameters:
    `separator` - The separator to insert between path components ("::" for statics).
    `rootSeparator` - `true` indicates the root is denoted with a leading separator.
  Returns:
    A fully qualified path.
  See Also:
    `getName()`, `getPath(String, boolean)`, `getComplete()`

### getComplete

    public java.util.List<java.lang.String> getComplete()

  Get the path and name for this identifier combined in a list. This will include the values returned by `getPath()` and `getName()` in that order.

  Returns:
    A fully qualified path list.
  See Also:
    `getName()`, `getPath(String, boolean)`, `getComplete(String, boolean)`

### getCatalog

    public HierarchicalCatalog<V> getCatalog()

  Get the catalog in which this identifier is finally bound to an object rather than another catalog. This will be the same catalog where the name `getName()` is bound.

  Returns:
    The catalog in which this identifier's name is bound.
  See Also:
    `getName()`

### get

    public V get()

  Simple accessor.

  Returns:
    The actual value named by this identifier.

### put

    public V put(V _value)

  Bind the name specified by this identifier to the given value and return the old value to which this identifier was bound.

  Parameters:
    `_value` - The new value to bind to this identifier.
  Returns:
    The old value, as returned by `get()`.

### isLambda

    public boolean isLambda()

  Check if this identifier doesn't actually have a real name to go with it. This is used to create identifiers for objects which do not actually have names.

  Returns:
    `true` if this identifier names an unnamed object.

### getRelative

    public QualifiedIdentifier<V> getRelative(java.lang.Object _catalog)

  Return a `QualifiedIdentifier` which names the same object as this identifier, but relative to the given catalog.

  Parameters:
    `_catalog` - The catalog which the resultant qualified identifier should be relative to.
  Returns:
    A qualified identifier relative to the given catalog which names the name object as this identifier.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD